#include<bits/stdc++.h>
#define int long long
#define N 1000005
using namespace std;
int n,m;
long double hh[N],h[N],r[N],R[N],ans,zr;
signed main(){
	freopen("wan.in","r",stdin);
	freopen("wan.out","w",stdout);
	cin.tie(0)->sync_with_stdio(0);
	cin>>n,m=min(n,N*20ll/n);
	for(int i=1,H,rr,RR;i<=n;i++){
		cin>>H>>rr>>RR,h[i]=H,r[i]=rr/2,R[i]=RR/2;
		for(int j=max(i-m,1ll);j<i;j++){
			long double x1=R[i]-r[i],y1=H,x2=R[j]-r[j],y2=h[j];
			if(r[i]>=R[j])hh[i]=max(hh[i],hh[j]+h[j]);//then r[i]<R[j]
			else if(R[i]<=r[j])hh[i]=max(hh[i],hh[j]);//then r[j]<R[i]
			else if(y1*x2>=y2*x1){
				if(r[i]<=r[j])hh[i]=max(hh[i],hh[j]);
				else hh[i]=max(hh[i],hh[j]+(r[i]-r[j])/x2*y2);
			}//then y1/x1<y2/x2
			else if(R[i]<=R[j])hh[i]=max(hh[i],hh[j]+max((R[i]-r[j])/x2*y2-h[i],zr));
			else hh[i]=max(hh[i],hh[j]+max(h[j]-(R[j]-r[i])/x1*y1,zr));
		}
		ans=max(ans,hh[i]+h[i]);
	}
	cout<<fixed<<setprecision(9)<<ans<<'\n';
	return 0;
}